from flask import Flask

def create_app():
    app = Flask(__name__)
    app.secret_key = 'your-secret_key_here_2025'

    # 延迟导入模型并初始化数据库
    from models import init_db
    init_db()

    # 延迟导入蓝图并注册
    from blueprints.web import web_bp
    from blueprints.api import api_bp

    app.register_blueprint(web_bp)
    app.register_blueprint(api_bp, url_prefix='/api')

    return app